home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 7_10.lha / 7_10 / 7_10process.h < prev    next >
Text File  |  1993-08-08  |  2KB  |  62 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / all discrete events are derived from class process
  6. lass process : public process_object
  7.  
  8.    // private: ...
  9. include "7_10pr1.h"        /* DELETE */
  10. include "7_10pr2.h"        /* DELETE */
  11. include "7_10pr3.h"        /* DELETE */
  12. ublic:
  13.    friend process_object;
  14.    char *t_name;        // the name of this process
  15.  
  16.    process(char *name = 0);
  17.    ~process();
  18.  
  19.    // process manipulation
  20.    void exec();        // run the process
  21.    virtual long main();    // the actual process
  22.    int pending();        // 1 until process completed
  23.    void exit(long);        // end process with value
  24.    long result();        // get exit value of process
  25.    void kill(long = 0);    // stop process
  26.  
  27.    // allow user to set t_exit_fct
  28.    PVFV atexit(PVFV);
  29.  
  30.    // Stop this process until one of the
  31.    // objects becomes available
  32.    int wait(process_object **);
  33.    int wait(process_object*, process_object* = 0,
  34.  process_object* = 0, process_object* = 0,
  35.  process_object* = 0, process_object* = 0);
  36.  
  37.    // Stop until rescheduled, then
  38.    // alert a process_object.
  39.    void pause(process_object* = 0);
  40.  
  41.    // Stop until time comes along
  42.    void sleep(unsigned long);
  43.  
  44.    // pseudo-time manipulation
  45.    unsigned long time()    // Get current time
  46.    { return t_curtime; }
  47.    void stime(unsigned long);    // Set current time
  48.  
  49.    // priority manipulation
  50.    int getpriority()        // Get current priority
  51.    { return t_priority; }
  52.    int setpriority(int);    // Set current priority
  53.  
  54.    // a pseudo-process for main()
  55.    friend process *const main_process();
  56.  
  57.    // provide safe access to t_thisprocess
  58.    friend process *const this_process();
  59.    ostream &print(ostream&);                // DELETE
  60.    void dumpall(ostream&);                // DELETE
  61. ;
  62.